package org.springbus.ff.node;

import org.springbus.ff.conf.FFBaseConf;
import org.springbus.ff.core.FFContext;
import org.springbus.ff.filter.Filter;
import org.springbus.ff.util.ImageUtils;

import javax.jws.Oneway;
import java.util.*;

public class FFBackGround  extends FFNode{
    private  String color;

        public FFBackGround(FFBaseConf conf) {
            super(conf,"background");
            this.color = conf.getColor();
            if (this.duration > 0) {
                this.duration = conf.getDuration();
            } else {
                this.duration = 999999f;
            }
        }

    public List<Object> concatFilters(FFContext context) {
        Filter f = this.toFilter(context);
        this.filters.add(f);
        return this.filters;
    }
    public Filter   toFilter(FFContext context) {
        Map<String, Object> op = new LinkedHashMap<>();
        op.put("c", this.color);
        op.put("d", this.duration);
        op.put("size", getSize());
        Filter filter = new Filter("color", op);
        filter.outputs=this.getOutId(false);
        context.input = this.getOutId(false);
        return filter;
    }
}
